package com.dc.project.entity.bo;

import com.dc.project.entity.po.Template;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TemplateBo
 *
 * @author chenxueli
 * @date 2025-03-19 10:40:23
 */
@Schema(title = "模板" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TemplateBo extends BaseBo<Template> implements Serializable {

    /**
     * 模板标题
     */
    private String title;

    /**
     * 模板key
     */
    private String key;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public Template toPo(Template entity) {
        if (entity == null) {
            entity = new Template();
        }
        entity.setTitle(this.title);
        entity.setKey(this.key);
        return super.toPo(entity);
    }

}

